﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Cfg;
using FluentNHibernate;

namespace cludg.Repository.NHibernate.Extensions
{
	public class NHMappingExtennsion_AddMapping : INHMappingExtension
	{
		protected Type MappingType { get; private set; }

		public NHMappingExtennsion_AddMapping(Type mappingType)
		{
			MappingType = mappingType;
		}

		void INHMappingExtension.Execute(MappingConfiguration mappingConfiguration)
		{
			mappingConfiguration.FluentMappings.Add(MappingType);
		}
	}

	public class NHMappingExtennsion_AddMapping<TMapping> : NHMappingExtennsion_AddMapping where TMapping : IMappingProvider
	{
		public NHMappingExtennsion_AddMapping()
			: base(typeof(TMapping))
		{			
		}
	}
}
